跳到主要内容

Push

Pushes a paragraph or a table or a block content control to actually add it to the current container.

Syntax

expression.Push(element);

expression - A variable that represents a ApiBlockLvlSdt class.

Parameters

NameRequired/OptionalData typeDefaultDescription
elementRequiredDocumentElementThe type of the element which will be pushed to the current container.

Returns

boolean

Example

This example pushes a paragraph to actually add it to the container.

let doc = Api.GetDocument();
let blockLvlSdt = Api.CreateBlockLvlSdt();
let paragraph = Api.CreateParagraph();
paragraph.AddText("This is a block text content control.");
blockLvlSdt.Push(paragraph);
doc.AddElement(0, blockLvlSdt);